package xlj.lib.android.base.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

public class SpUtil {
    private static final String SP = "set";
    public static void saveStudentFirst(Context context, boolean isFirst){
        SharedPreferences sp = context.getSharedPreferences(SP, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sp.edit();
        editor.putBoolean("is_student_first",isFirst);
        editor.commit();
    }

    public static boolean loadSutdentFirst(Context context){
        SharedPreferences sp = context.getSharedPreferences(SP,Context.MODE_PRIVATE);
        return sp.getBoolean("is_student_first",true);
    }
    public static void saveTeacherFirst(Context context, boolean isFirst){
        SharedPreferences sp = context.getSharedPreferences(SP, Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sp.edit();
        editor.putBoolean("is_teacher_first",isFirst);
        editor.commit();
    }

    public static boolean loadTeacherFirst(Context context){
        SharedPreferences sp = context.getSharedPreferences(SP,Context.MODE_PRIVATE);
        boolean isFirst = sp.getBoolean("is_teacher_first",true);
        Log.e("123","isFirst="+isFirst);
        return isFirst;
    }
}
